package libs.yzx.zaza.acts;

import android.graphics.Bitmap;
import android.os.Bundle;
import android.os.Environment;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.widget.Toast;

import java.io.File;

import libs.yzx.zaza.za.BitmapCompress;

/**
 * Created by Administrator on 2016/9/2
 */
public class ImageLoadActivity extends AppCompatActivity{

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public void onBackPressed() {
        File old = new File(Environment.getExternalStorageDirectory(), "aaa6.jpg");
        File newf = new File(Environment.getExternalStorageDirectory(), "aaa"+ System.currentTimeMillis()/1000 +".jpg");


        File result = new BitmapCompress().compressImageToNew(old, 100, 1024, 1024, Bitmap.Config.ARGB_8888, newf);



        Toast.makeText(ImageLoadActivity.this, ""+(result == null), Toast.LENGTH_SHORT).show();
    }



}
